package com.ruicar.afs.cloud.basic.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.basic.common.entity.BasicAssetsRepaymentPlan;
import com.ruicar.afs.cloud.basic.common.entity.BasicReceiptDealDetails;
import com.ruicar.afs.cloud.basic.common.entity.BasicRepaymentPlan;
import com.ruicar.afs.cloud.common.modules.contract.enums.WriteTargetTypeEnum;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author: Lee
 * @date 2020-05-30 04:34:34 
 * @description 
 */
public interface BasicAssetsRepaymentPlanService extends IService<BasicAssetsRepaymentPlan> {

    /**
     * 核销利息
     * @author ZC.GUO
     * @param repaymentPlan 还款计划
     * @param amount 核销金额
     * @param actualAmount 本合同本期已收利息
     * @param writeTarget 核销目的
     * @param receivableAmount 本合同本期应收利息
     * @return
     */
    public void handleInterest(BasicReceiptDealDetails receiptDealDetails, BasicRepaymentPlan repaymentPlan, BigDecimal amount, BigDecimal actualAmount, BigDecimal receivableAmount, WriteTargetTypeEnum writeTarget, Date batchDate);

    /**
     * 核销本金
     * @author ZC.GUO
     * @param repaymentPlan 还款计划
     * @param amount 核销金额
     * @param actualAmount 本合同本期已收本金
     * @param writeTarget 核销目的
     * @param receivableAmount 本合同本期应收本金
     * @return
     */
    public void handlePrinciple(BasicReceiptDealDetails receiptDealDetails,BasicRepaymentPlan repaymentPlan, BigDecimal amount,BigDecimal actualAmount,BigDecimal receivableAmount,  WriteTargetTypeEnum writeTarget, Date batchDate);

    /**
     * 撤销利息
     * @author ZC.GUO
     * @param repaymentPlan 还款计划
     * @return
     */
    public void cancelInterest(Long receiptDetailId,BasicRepaymentPlan repaymentPlan, Date batchDate);

    /**
     * 撤销本金
     * @author ZC.GUO
     * @param repaymentPlan 还款计划
     * @return
     */
    public void cancelPrinciple(Long receiptDetailId,BasicRepaymentPlan repaymentPlan, Date batchDate);


}
